﻿using System.Windows.Automation;

namespace QuickUIT.Controls
{
    /// <summary>
    /// Represents a scroll bar control. 
    /// </summary>
    public class UIScrollBar : UIBaseControl
    {
        /// <summary>
        /// Specifies current range value for the scroll bar control. 
        /// </summary>
        public new double RangeValue
        {
            get { return base.RangeValue; }
            set { SetRangeValue(value); }
        }

        /// <summary>
        /// Gets a value which indicates whether the value of a range control is read-only.
        /// </summary>
        public new bool IsRangeReadOnly
        {
            get { return base.IsRangeReadOnly; }
        }

        /// <summary>
        /// Gets the maximum value for the scroll bar control. 
        /// </summary>
        public new double Maximum
        {
            get { return base.Maximum; }
        }

        /// <summary>
        /// Gets the minimum value for the scroll bar control.
        /// </summary>
        public new double Minimum
        {
            get { return base.Minimum; }
        }

        /// <summary>
        /// Gets the large change value for the scroll bar control. 
        /// </summary>
        public new double LargeChange
        {
            get { return base.LargeChange; }
        }

        /// <summary>
        /// Gets the small change value for the scroll bar control. 
        /// </summary>
        public new double SmallChange
        {
            get { return base.SmallChange; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIScrollBar"/> class. 
        /// </summary>
        public UIScrollBar()
            : base(ControlType.ScrollBar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIScrollBar"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        public UIScrollBar(UIBaseControl parent)
            : base(parent, ControlType.ScrollBar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIScrollBar"/> class.
        /// </summary>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIScrollBar(string locator)
            : base(null, ControlType.ScrollBar, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIScrollBar"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIScrollBar(UIBaseControl parent, string locator)
            : base(parent, ControlType.ScrollBar, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIScrollBar"/> class.
        /// </summary>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIScrollBar(AutomationElement control) : base(control, ControlType.ScrollBar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIScrollBar"/> class.
        /// </summary>
        /// <param name="parent">The parent of the control</param>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIScrollBar(UIBaseControl parent, AutomationElement control) : base(parent, control, ControlType.ScrollBar)
        {
        }

        /// <summary>
        /// Sets the range value of scroll bar, if supported.  
        /// </summary>
        /// <param name="value">The value to set.</param>
        public new void SetRangeValue(double value)
        {
            base.SetRangeValue(value);
        }
    }
}
